package com.itzhoun.controller;

import com.itzhoun.common.Result;
import com.itzhoun.common.ResultBuilder;
import com.itzhoun.groups.UserGroups;
import com.itzhoun.vo.UserVO;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 周楠
 * @Date 2022/06/28/下午 11:14
 */
@RestController
public class UserController {

    /**
     * 参数校验 springboot自带参数和 自定义参数
     * @param userVO
     * @return
     */
    @PostMapping("/user")
    public Result<Boolean> user(@RequestBody @Validated(value = UserGroups.class) UserVO userVO){
        return ResultBuilder.success(true);
    }

}
